How to store data in a local SQLite.NET database in Xamarin?
نوشته شده توسط : dotnek

In this tutorial you will learn:

- How to store data in the local Xamarin database ?- How to use a NuGet Package Manager to add a NuGet Package?Note: In order to be able to do this project, you must have already successfully completed the project of building multi-page applications .

How to use local storage in Xamarin Forms using Visual Studio?

1- Open Visual Studio

2- Open the Notes solution project.

3- In the Solution Explorer section, select the Notes project and right-click on it.

4- After right-clicking on the project, select Manage NuGet Packages.

5- In the NuGet Package Manager section, select the Browser tab to search.

6- Search for the SQLite-net-plc. package in NuGet , and after finding it, click Install to add it to the project.

Note:

There are packages with similar names, the package you should choose has the following specifications:- Author (s): Frank A. Krueger

- Id: SQLite-net-plc.

- NuGet link: SQLite-net-plc.- Open the Models folder in the Solution Explorer section of the Note.cs project and delete the existing code and enter the following code there.

using System;
using SQLite;


namespace Notes. Models
{
public class Note
{
[PrimaryKey, AutoIncrement]
public int ID {get; set;}
public string Text {get; set;}
public DateTime Date {get; set;}
}
}

These codes define the Note model, which is used to store note data in applications .Each note in the SQLite.NET database has its own unique id, in fact the ID, PrimeryKey, and AutoIncrement attributes make each note have its own id.1- Record the changes made and exit that window.

2- Create a folder called Data in the Solution Explorer section and add it to the Notes project.

3- In the folder created in the Notes project and in the Solution Explorer section, create a class called NoteDatabase.

4- In the created NoteDatabase.cs class, delete all existing codes and replace the following codes. 

Read more on:https://www.dotnek.com/Blog/Apps/how-to-store-data-in-a-local-sqlitenet-databa

link:https://dotnek.mystrikingly.com/

Related link:Search engine Optimization (SEO services)





:: برچسب‌ها: dotnek , seo , site ,
:: بازدید از این مطلب : 89
|
امتیاز مطلب : 0
|
تعداد امتیازدهندگان : 0
|
مجموع امتیاز : 0
تاریخ انتشار : دو شنبه 4 مرداد 1400 | نظرات ()
مطالب مرتبط با این پست
لیست
می توانید دیدگاه خود را بنویسید


نام
آدرس ایمیل
وب سایت/بلاگ
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

آپلود عکس دلخواه: